package cn.wolfcode.crm.query;/**
 * Created by 10797 on 2018/7/14.
 */

import cn.wolfcode.crm.util.DateUtil;
import com.alibaba.druid.util.StringUtils;
import lombok.Getter;
import lombok.Setter;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

/**
 * @program: crm
 * @description:
 * @author: Mr.chen
 * @create: 2018-07-14 10:52
 **/
@Setter
@Getter
public class PaymentResultQueryObject extends QueryObject {

    private String keyword;
    private String number;
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date beginDate;
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date endDate;

    public Date getEndDate() {
        if (endDate != null) {
            return DateUtil.getEndDate(endDate);
        }
        return null;
    }
    public String getClientName(){
        return !StringUtils.isEmpty(keyword) ? keyword : null;
    }

    public String getSn(){
        return !StringUtils.isEmpty(number) ? number : null;
    }

}
